package lab02.text03;

/**
 * Created by dell on 2017/10/12.
 */
public class Student {
    //属性：计算机成绩、数学成绩、英语成绩
   float computerScore;
    float mathScore;
    float englishScore;



    //行为：总分、平均分、最高分、最低分，并输出完整的信息
     float sum(){
         return computerScore+mathScore+englishScore;
     }
    float average(){
         return computerScore+mathScore+englishScore % 3;
    }
    float maxScore() {
        if(computerScore>englishScore&&computerScore>mathScore)
             return computerScore;
         else if (mathScore>englishScore&&mathScore>computerScore)
             return mathScore;
         else return englishScore;
    }
  void minScore(){
      if (computerScore<mathScore&&computerScore<englishScore)
               return computerScore;
          else if (mathScore<englishScore&&mathScore<computerScore)
                  return mathScore;
           else return englishScore;
  }
  void printStudent(){
      System.out.println("计算机成绩："+computerScore);
      System.out.println("数学成绩："+mathScore);
      System.out.println("英语成绩："+englishScore);
      System.out.println("总分："+sum());
      System.out.println("平均分："+average());
      System.out.println("最高分："+maxScore());
      System.out.println("最低分："+minScore());
  }

    public static void main(String[] args) {

    }
}
